using System;
using System.ComponentModel.DataAnnotations;

namespace JGSY.CMS.LowCode.Platform.Application.DTOs
{
    /// <summary>
    /// 团队数据传输对象
    /// 用于传输团队相关的数据信息，包括团队成员、所属部门等
    /// </summary>
    public class TeamDto
    {
        /// <summary>
        /// 团队ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 团队名称
        /// </summary>
        [Required(ErrorMessage = "团队名称不能为空")]
        [StringLength(255, ErrorMessage = "团队名称长度不能超过255个字符")]
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 团队编码
        /// </summary>
        [StringLength(50, ErrorMessage = "团队编码长度不能超过50个字符")]
        public string? Code { get; set; }

        /// <summary>
        /// 所属部门ID
        /// </summary>
        public long DepartmentId { get; set; }

        /// <summary>
        /// 团队描述
        /// </summary>
        [StringLength(500, ErrorMessage = "团队描述长度不能超过500个字符")]
        public string? Description { get; set; }

        /// <summary>
        /// 团队负责人ID
        /// </summary>
        public long? LeaderId { get; set; }

        /// <summary>
        /// 团队类型
        /// </summary>
        [StringLength(50, ErrorMessage = "团队类型长度不能超过50个字符")]
        public string? TeamType { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [StringLength(20, ErrorMessage = "联系电话长度不能超过20个字符")]
        public string? Phone { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [StringLength(255, ErrorMessage = "邮箱长度不能超过255个字符")]
        [EmailAddress(ErrorMessage = "邮箱格式不正确")]
        public string? Email { get; set; }

        /// <summary>
        /// 最大成员数
        /// </summary>
        [Range(1, int.MaxValue, ErrorMessage = "最大成员数必须大于0")]
        public int? MaxMembers { get; set; }

        /// <summary>
        /// 团队目标
        /// </summary>
        [StringLength(1000, ErrorMessage = "团队目标长度不能超过1000个字符")]
        public string? Goals { get; set; }

        /// <summary>
        /// 排序权重
        /// </summary>
        public int SortOrder { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public byte Status { get; set; }

        /// <summary>
        /// 版本号
        /// </summary>
        public int Version { get; set; }

        /// <summary>
        /// 创建人ID
        /// </summary>
        public long CreatedBy { get; set; }

        /// <summary>
        /// 修改人ID
        /// </summary>
        public long? UpdatedBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime UpdatedAt { get; set; }

        /// <summary>
        /// 创建人姓名
        /// </summary>
        public string? CreatorName { get; set; }

        /// <summary>
        /// 修改人姓名
        /// </summary>
        public string? UpdaterName { get; set; }

        /// <summary>
        /// 所属部门名称
        /// </summary>
        public string? DepartmentName { get; set; }

        /// <summary>
        /// 团队负责人姓名
        /// </summary>
        public string? LeaderName { get; set; }

        /// <summary>
        /// 当前成员数
        /// </summary>
        public int MemberCount { get; set; }

        /// <summary>
        /// 活跃成员数
        /// </summary>
        public int ActiveMemberCount { get; set; }
    }
}
